<?php


ini_set("display_errors", "On");
error_reporting(E_ALL);

// 引入数据库连接文件
require_once '../../../../sql/connection.php';

$deleteID = $_POST['deleteID'];

// 查询语句
$query_sql = "select id, create_time, update_time, name, is_delete from  class_info where id = '$deleteID'";
// 连接数据库，并查询
$result = mysqli_query($GLOBALS['conn'], $query_sql);

$now = date('Y-m-d H:i:s', time());
$deleteSql = "UPDATE class_info set is_delete = 1 where id = '$deleteID'";
if (mysqli_query($GLOBALS['conn'], $deleteSql)) {
echo "
    <script>
        alert('删除成功！');
        window.location.href=document.referrer;
    </script>
    ";
} else {
echo "
    <script> 
        alert('删除失败！');
        history.back();
    </script>
    ";
}

